﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace MobileRecharge
{
    public partial class HomePage : System.Web.UI.MasterPage
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                if (Session["Username"] != null)
                {
                    hplUsername.Text = "Welcome, " + Session["Username"].ToString();
                    hplUsername.Visible = true;
                    btlLogout.Visible = true;
                    hplMyBill.Visible = true;
                    hplLogin.Visible = false;
                    hplRegister.Visible = false;
                    hplCustomerCare.Visible = true;
                }
            }
            
        }

        protected void btnLogout_Click(object sender, EventArgs e)
        {
            Session["Username"] = null;
            hplUsername.Visible = false;
            hplUsername.Text = "";
            btlLogout.Visible = false;
            hplLogin.Visible = true;
            hplMyBill.Visible = false;
            hplRegister.Visible = true;
            hplCustomerCare.Visible = false;
            Response.Redirect("Default.aspx");
        }
    }
}